﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Flipmind.Xero
{
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Invoice
    {
        /// <summary>
        /// Should not be populated when creating invoices, only relivant for invoices fetched from Xero
        /// </summary>
        private string invoiceIDField;

        private InvoiceType invoiceTypeField;

        private InvoiceStatus invoiceStatusField;

        private Contact contactField = new Contact();

        private System.DateTime invoiceDateField;

        private System.DateTime dueDateField;

        private string invoiceNumberField;

        private string referenceField;

        private bool includesTaxField;

        private decimal subTotalField;

        private decimal totalTaxField;

        private decimal totalField;

        private List<InvoiceLineItem> lineItemsField = new List<InvoiceLineItem>();

        /// <remarks/>
        public InvoiceType InvoiceType
        {
            get
            {
                return this.invoiceTypeField;
            }
            set
            {
                this.invoiceTypeField = value;
            }
        }

        public InvoiceStatus InvoiceStatus
        {
            get
            {
                return this.invoiceStatusField;
            }
            set
            {
                this.invoiceStatusField = value;
            }
        }


        /// <remarks/>
        public Contact Contact
        {
            get
            {
                return this.contactField;
            }
            set
            {
                this.contactField = value;
            }
        }

        /// <remarks/>
        public System.DateTime InvoiceDate
        {
            get
            {
                return this.invoiceDateField;
            }
            set
            {
                this.invoiceDateField = value;
            }
        }

        /// <remarks/>
        public System.DateTime DueDate
        {
            get
            {
                return this.dueDateField;
            }
            set
            {
                this.dueDateField = value;
            }
        }

        /// <remarks/>
        public string InvoiceID
        {
            get
            {
                return this.invoiceIDField;
            }
            set
            {
                this.invoiceIDField = value;
            }
        }

        /// <remarks/>
        public string InvoiceNumber
        {
            get
            {
                return this.invoiceNumberField;
            }
            set
            {
                this.invoiceNumberField = value;
            }
        }

        /// <remarks/>
        public string Reference
        {
            get
            {
                return this.referenceField;
            }
            set
            {
                this.referenceField = value;
            }
        }

        /// <remarks/>
        public bool IncludesTax
        {
            get
            {
                return this.includesTaxField;
            }
            set
            {
                this.includesTaxField = value;
            }
        }

        /// <remarks/>
        public decimal SubTotal
        {
            get
            {
                return this.subTotalField;
            }
            set
            {
                this.subTotalField = value;
            }
        }
        
        /// <remarks/>
        public decimal TotalTax
        {
            get
            {
                return this.totalTaxField;
            }
            set
            {
                this.totalTaxField = value;
            }
        }

        /// <remarks/>
        public decimal Total
        {
            get
            {
                return this.totalField;
            }
            set
            {
                this.totalField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute("LineItem", IsNullable = false)]
        public List<InvoiceLineItem> LineItems
        {
            get
            {
                return this.lineItemsField;
            }
            set
            {
                this.lineItemsField = value;
            }
        }
    }


    /// <summary>
    /// 
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public partial class InvoiceLineItem
    {

        private string descriptionField;

        private decimal quantityField;

        private decimal unitAmountField;

        private TaxType taxTypeField;

        private decimal taxAmountField;

        private decimal lineAmountField;

        private string accountCodeField;

        private InvoiceLineItemTrackingCategory trackingField;

        /// <remarks/>
        public string Description
        {
            get
            {
                return this.descriptionField;
            }
            set
            {
                this.descriptionField = value;
            }
        }

        /// <remarks/>
        public decimal Quantity
        {
            get
            {
                return this.quantityField;
            }
            set
            {
                this.quantityField = value;
            }
        }

        /// <remarks/>
        public decimal UnitAmount
        {
            get
            {
                return this.unitAmountField;
            }
            set
            {
                this.unitAmountField = value;
            }
        }

        /// <remarks/>
        public TaxType TaxType
        {
            get
            {
                return this.taxTypeField;
            }
            set
            {
                this.taxTypeField = value;
            }
        }

        /// <remarks/>
        public decimal TaxAmount
        {
            get
            {
                return this.taxAmountField;
            }
            set
            {
                this.taxAmountField = value;
            }
        }

        /// <remarks/>
        public decimal LineAmount
        {
            get
            {
                return this.lineAmountField;
            }
            set
            {
                this.lineAmountField = value;
            }
        }

        /// <remarks/>
        public string AccountCode
        {
            get
            {
                return this.accountCodeField;
            }
            set
            {
                this.accountCodeField = value;
            }
        }

        /// <remarks/>
        public InvoiceLineItemTrackingCategory Tracking
        {
            get
            {
                return this.trackingField;
            }
            set
            {
                this.trackingField = value;
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public partial class InvoiceLineItemTrackingCategory
    {

        private string nameField;

        private string optionField;

        public InvoiceLineItemTrackingCategory()
        {
        }

        public InvoiceLineItemTrackingCategory(string name, string option)
        {
            this.nameField = name;
            this.optionField = option;
        }

        /// <remarks/>
        public string Name
        {
            get
            {
                return this.nameField;
            }
            set
            {
                this.nameField = value;
            }
        }

        /// <remarks/>
        public string Option
        {
            get
            {
                return this.optionField;
            }
            set
            {
                this.optionField = value;
            }
        }
    }
}
